package com.cxx.purchasecharge.dal;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import com.cxx.purchasecharge.core.model.persistence.Region;
import com.cxx.purchasecharge.dal.common.GenericCRUDDao;

@Transactional
public interface RegionDao extends GenericCRUDDao <Region, Long>
{

    public Region findById (long id);

    @Query (value = "select g from Region g where g.parent.id=?1")
    public List <Region> findByParent (Long parentId);
    
    public Region findByName (String name);
}
